There exist electronic slave devices that receive P-bit-wide symbols transmitted from an external electronic master device, X symbols being placed within an N-bit-wide data word which is transmitted in one go from the master device to the slave device via a system bus.
These slave devices have writable memory for storing the symbols locally before they are processed.
Data word packing is often necessary to suit the characteristics of the slave device memory.
For example, if symbols generated by the master device are coded in 4 bits and sent one at a time in a 32-bit-wide data word, a transport format may define that the 4 bits of the symbol occupy the four least significant bits (LSB) of the data word whereas the other 28 bits of the data word are of no interest to this slave device.
The transport format defines the position of each symbol within a data word.
If the slave device memory is a 32-bit-wide memory and the received data word is recorded in the memory as it is received, 28 bits out of 32 bits of each memory row are wasted. To avoid such a waste, data packing should be done before recording symbols in the memory. In the above example, data packing may consist of gathering, into a single rearranged data word, the symbols received in eight data words. Then, only the rearranged data word is recorded in the slave device memory to save memory space.
Data packing is done by a data packing block. The data packing block may be implemented by software in the master device or in the slave device. However, such a software implementation of the data packing block consumes many CPU (Computing Processing Unit) clock cycles.
The data packing block may also be implemented by hardware. The data packing is then faster than with a software implementation. However, hardware data packing blocks are suited only to one specific transport format. As a result, a slave device incorporating such a hardware data packing block is not very flexible because it can only be used with one predetermined data word transport format.